// DisplayComponentDlg.cpp : implementation file
//

#include "stdafx.h"
#include "DisplayComponent.h"
#include "DisplayComponentDlg.h"
#include "DisplayTest.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// DisplayComponentDlg dialog

DisplayComponentDlg::DisplayComponentDlg(CWnd* pParent /*=NULL*/)
	: CDialog(DisplayComponentDlg::IDD, pParent)
{
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void DisplayComponentDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}

BEGIN_MESSAGE_MAP(DisplayComponentDlg, CDialog)
#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	ON_WM_SIZE()
#endif
	//}}AFX_MSG_MAP
	ON_BN_CLICKED(IDC_BUTTON_OKEY, &DisplayComponentDlg::OnBnClickedButtonOkey)
END_MESSAGE_MAP()


// DisplayComponentDlg message handlers

BOOL DisplayComponentDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	// TODO: Add extra initialization here
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

#if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
void DisplayComponentDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
	if (AfxIsDRAEnabled())
	{
		DRA::RelayoutDialog(
			AfxGetResourceHandle(), 
			this->m_hWnd, 
			DRA::GetDisplayMode() != DRA::Portrait ? 
			MAKEINTRESOURCE(IDD_DISPLAYCOMPONENT_DIALOG_WIDE) : 
			MAKEINTRESOURCE(IDD_DISPLAYCOMPONENT_DIALOG));
	}
}
#endif

void DisplayComponentDlg::OnBnClickedButtonOkey()
{
	// TODO: Add your control notification handler code here
/*
// Check Button Practice ++
	CButton chk_btn_test_pattern;
	chk_btn_test_pattern.Attach(GetDlgItem(IDC_CHECK_TEST_PATTERN)->GetSafeHwnd());

	BOOL is_test_pattern =  BST_CHECKED == chk_btn_test_pattern.GetCheck() ? true:false;

	chk_btn_test_pattern.Detach();
	if( is_test_pattern){
		::MessageBox( NULL, L"OK, Kaili is so strong!!", L"OK", MB_OKCANCEL | MB_ICONQUESTION );
	} else {
		::MessageBox( NULL, L"OK, Lubo is so strong!!", L"Lubo OK", MB_OKCANCEL | MB_ICONQUESTION );
	}
// Check Button Practice --
*/
	DisplayTest myTest;// = new DisplayTest;	
	myTest.PaintTest(this->m_hWnd);
}
